//
// Created by 123 on 2024/12/27.
//
#include <stdio.h>

int main075(){
    FILE* fp;
    int ch;
    fp = fopen("test075.txt","w");
    if(fp == NULL){
        perror("file open failure");
        return 1;
    }
    //写入字符
    fputc('H',fp);
    fputc('e',fp);
    fputc('l',fp);
    fputc('l',fp);
    fputc('o',fp);
    fputc('\n',fp);
    //关闭资源
    fclose(fp);

    //读取文件
    fp = fopen("test075.txt","r");
    if(fp == NULL){
        perror("file open failure");
        return 1;
    }
    while ((ch = fgetc(fp)) != EOF){
        putchar(ch) ;
    }
    fclose(fp);

    return 0;
}